#pragma once
#include <QWidget>
#include <qframe.h>
#include <QComboBox>
#include <QTimer>
#include <QDialog>
#include "ui_VSearchDlg.h"

class VSearchDlg : public QDialog
{
	Q_OBJECT

public:
    explicit VSearchDlg(QWidget *parent = Q_NULLPTR);
	~VSearchDlg();

	void set_active();
signals:
    void signal_find(const QString &expr, bool re, bool cs, bool wo,
                     bool wrap, bool forward = true, int line = -1, int index = -1,
                     bool show = true, bool posix = false, bool cxx11 = false,
                     QString rexpr = "", bool replace = false, bool replace_all = false);

public slots:
    void slot_show_text(QString text, int time);

private slots:
    void on_btn_hide_clicked();
    void on_radio_regexp_toggled(bool checked);
    void on_btn_find_clicked();
    void on_timerout();
    void on_btn_replace_clicked();
    void on_btn_replace_all_clicked();

private:
	Ui::VSearchDlg ui;

    QTimer _timer;
    bool combobox_container(QComboBox *combobox, QString text);
};
